﻿using System;
namespace Xtee.XteeClient.Ehr {
    using Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr;
    using Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages;
    using global::Xtee.Core;
    using System.Collections.Generic;
    
    
    public class EhrAdapter {
        
        private string _producer = "ehr";
        
        private string _toimik;
        
        private string _allAsutus;
        
        private string _amet;
        
        private string _ametnikNimi;
        
        private string _autentija;
        
        private string _ametnik;
        
        private Xtee.Core.Client.IXteeCommand _xteeCommand;
        
        public EhrAdapter() : 
                this(new Xtee.Core.Client.XteeCommand(new Xtee.Core.Client.Config.Configuration())) {
        }
        
        public EhrAdapter(Xtee.Core.Client.IXteeCommand command) {
            this._xteeCommand = command;
            if (!string.IsNullOrEmpty(_xteeCommand.Configuration.AlternateProducer)) {
                this._producer = _xteeCommand.Configuration.AlternateProducer;
            }
        }
        
        public virtual string Producer {
            get {
                return this._producer;
            }
            set {
                this._producer = value;
            }
        }
        
        public virtual string Toimik {
            get {
                return this._toimik;
            }
            set {
                this._toimik = value;
            }
        }
        
        public virtual string AllAsutus {
            get {
                return this._allAsutus;
            }
            set {
                this._allAsutus = value;
            }
        }
        
        public virtual string Amet {
            get {
                return this._amet;
            }
            set {
                this._amet = value;
            }
        }
        
        public virtual string AmetnikNimi {
            get {
                return this._ametnikNimi;
            }
            set {
                this._ametnikNimi = value;
            }
        }
        
        public virtual string Autentija {
            get {
                return this._autentija;
            }
            set {
                this._autentija = value;
            }
        }
        
        public virtual string Ametnik {
            get {
                return this._ametnik;
            }
            set {
                this._ametnik = value;
            }
        }
        
        public virtual Xtee.Core.Client.IXteeCommand XteeCommand {
            get {
                return this._xteeCommand;
            }
            set {
                this._xteeCommand = value;
            }
        }
        
        public virtual string KonstrueeriTeenuseNimi(string teenuseNimi, string versioon) {
            return string.Format("{0}.{1}.{2}", this.Producer, teenuseNimi,versioon);
        }
        
        public virtual global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IENEhitiseOtsingResponse ENEhitiseOtsing(global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IENEhitiseOtsingQuery keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.ehr.xtee.riik.ee/producer/ehr", "EN_EhitiseOtsing", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("EN_EhitiseOtsing", "v1"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.ENEhitiseOtsing(keha)));
            return ((global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.IENEhitiseOtsingResponse)(responseEnvelope.Body)).Keha;
        }
        
        public virtual global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IENLisaBroneeringResponse ENLisaBroneering(global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IENLisaBroneeringQuery keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.ehr.xtee.riik.ee/producer/ehr", "EN_LisaBroneering", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("EN_LisaBroneering", "v1"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.ENLisaBroneering(keha)));
            return ((global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.IENLisaBroneeringResponse)(responseEnvelope.Body)).Keha;
        }
        
        public virtual global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IENOtsiAadressiKyResponse ENOtsiAadressiKy(global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IENOtsiAadressiKyQuery keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.ehr.xtee.riik.ee/producer/ehr", "EN_OtsiAadressiKy", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("EN_OtsiAadressiKy", "v1"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.ENOtsiAadressiKy(keha)));
            return ((global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.IENOtsiAadressiKyResponse)(responseEnvelope.Body)).Keha;
        }
        
        public virtual global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IENEhitiseOsaAndmedResponse ENEhitiseOsaAndmed(global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IENEhitiseOsaAndmedQuery keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.ehr.xtee.riik.ee/producer/ehr", "EN_EhitiseOsaAndmed", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("EN_EhitiseOsaAndmed", "v1"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.ENEhitiseOsaAndmed(keha)));
            return ((global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.IENEhitiseOsaAndmedResponse)(responseEnvelope.Body)).Keha;
        }
        
        public virtual global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IENOrgYldAndmedResponse ENOrgYldAndmed(global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IENOrgYldAndmedQuery keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.ehr.xtee.riik.ee/producer/ehr", "EN_OrgYldAndmed", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("EN_OrgYldAndmed", "v1"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.ENOrgYldAndmed(keha)));
            return ((global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.IENOrgYldAndmedResponse)(responseEnvelope.Body)).Keha;
        }
        
        public virtual global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IENOtsiDokumentiResponse ENOtsiDokumenti(global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IENOtsiDokumentiQuery keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.ehr.xtee.riik.ee/producer/ehr", "EN_OtsiDokumenti", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("EN_OtsiDokumenti", "v1"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.ENOtsiDokumenti(keha)));
            return ((global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.IENOtsiDokumentiResponse)(responseEnvelope.Body)).Keha;
        }
        
        public virtual global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IENOtsiAadressiAdrResponse ENOtsiAadressiAdr(global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IENOtsiAadressiAdrQuery keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.ehr.xtee.riik.ee/producer/ehr", "EN_OtsiAadressiAdr", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("EN_OtsiAadressiAdr", "v1"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.ENOtsiAadressiAdr(keha)));
            return ((global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.IENOtsiAadressiAdrResponse)(responseEnvelope.Body)).Keha;
        }
        
        public virtual global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IENOtsiAadressiAdrTxtResponse ENOtsiAadressiAdrTxt(global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IENOtsiAadressiAdrTxtQuery keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.ehr.xtee.riik.ee/producer/ehr", "EN_OtsiAadressiAdrTxt", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("EN_OtsiAadressiAdrTxt", "v1"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.ENOtsiAadressiAdrTxt(keha)));
            return ((global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.IENOtsiAadressiAdrTxtResponse)(responseEnvelope.Body)).Keha;
        }
        
        public virtual global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IENOtsiAadressiIskResponse ENOtsiAadressiIsk(global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IENOtsiAadressiIskQuery keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.ehr.xtee.riik.ee/producer/ehr", "EN_OtsiAadressiIsk", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("EN_OtsiAadressiIsk", "v1"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.ENOtsiAadressiIsk(keha)));
            return ((global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.IENOtsiAadressiIskResponse)(responseEnvelope.Body)).Keha;
        }
        
        public virtual global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IENEhitiseAndmedResponse ENEhitiseAndmed(global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IENEhitiseAndmedQuery keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.ehr.xtee.riik.ee/producer/ehr", "EN_EhitiseAndmed", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("EN_EhitiseAndmed", "v1"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.ENEhitiseAndmed(keha)));
            return ((global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.IENEhitiseAndmedResponse)(responseEnvelope.Body)).Keha;
        }
        
        public virtual global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IVallasvaraVastusType Vallasvara(global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IVallasvaraParingType keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.ehr.xtee.riik.ee/producer/ehr", "vallasvara", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("vallasvara", "v1"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.VallasvaraIn(keha)));
            return ((global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.IVallasvaraResponseOut)(responseEnvelope.Body)).Keha;
        }
        
        public virtual global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IDokumendidVastusType Dokumendid(global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IDokumendidParingType keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.ehr.xtee.riik.ee/producer/ehr", "dokumendid", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("dokumendid", "v1"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.DokumendidIn(keha)));
            return ((global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.IDokumendidResponseOut)(responseEnvelope.Body)).Keha;
        }
        
        public virtual global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IAndmeprobleemiTeatisVastusType AndmeprobleemiTeatis(global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IAndmeprobleemiTeatisParingType keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.ehr.xtee.riik.ee/producer/ehr", "andmeprobleemi_teatis", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("andmeprobleemi_teatis", "v1"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.AndmeprobleemiTeatisIn(keha)));
            return ((global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.IAndmeprobleemiTeatisResponseOut)(responseEnvelope.Body)).Keha;
        }
        
        public virtual global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IKatastriyksuseTeatisVastusType KatastriyksuseTeatis(global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IKatastriyksuseTeatisParingType keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.ehr.xtee.riik.ee/producer/ehr", "katastriyksuse_teatis", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("katastriyksuse_teatis", "v1"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.KatastriyksuseTeatisIn(keha)));
            return ((global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.IKatastriyksuseTeatisResponseOut)(responseEnvelope.Body)).Keha;
        }
        
        public virtual global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IVallasvaraPiirangudVastusType VallasvaraPiirangud(global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IVallasvaraPiirangudParingType keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.ehr.xtee.riik.ee/producer/ehr", "vallasvara_piirangud", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("vallasvara_piirangud", "v1"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.VallasvaraPiirangudIn(keha)));
            return ((global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.IVallasvaraPiirangudResponseOut)(responseEnvelope.Body)).Keha;
        }
        
        public virtual global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IEhitisedVastusType Ehitised(global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IEhitisedParingType keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.ehr.xtee.riik.ee/producer/ehr", "ehitised", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("ehitised", "v1"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.EhitisedIn(keha)));
            return ((global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.IEhitisedResponseOut)(responseEnvelope.Body)).Keha;
        }
        
        public virtual global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IKatastriyksusegaSeotudObjektidVastusType KatastriyksusegaSeotudObjektid(global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.IKatastriyksusegaSeotudObjektidParingType keha) {
            global::Xtee.Core.Envelope.ISoapEnvelope responseEnvelope = _xteeCommand.Execute(new global::Xtee.Core.Envelope.SoapEnvelope("http://producers.ehr.xtee.riik.ee/producer/ehr", "katastriyksusega_seotud_objektid", new Xtee.Core.Envelope.StandardHeader(_xteeCommand.Configuration.Asutus, this.Producer, _xteeCommand.Configuration.Isikukood, Xtee.Core.Utils.StringUtils.GenerateNonce(), this.KonstrueeriTeenuseNimi("katastriyksusega_seotud_objektid", "v1"), this.Toimik, this.AllAsutus, this.Amet, this.AmetnikNimi, this.Autentija), new global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.KatastriyksusegaSeotudObjektidIn(keha)));
            return ((global::Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr.Messages.IKatastriyksusegaSeotudObjektidResponseOut)(responseEnvelope.Body)).Keha;
        }
    }
}
